{template header}
<style type="text/css">
  .boardDiv{margin-bottom: 10px;}
  .boardList{margin: 10px auto;}
  .boardList li{list-style-type:none;float:left;margin:2px 9px;background-color:#dbeaf9;padding:5px;cursor:pointer;border-radius: 8px;}
  .boardInfo{clear:both;padding-top: 20px;}
  .tagList ul {margin: 0;}
 .boardList li, 
.tagList li{
    list-style-type:none; margin:4px 9px;background-color:#dbeaf9;padding:5px 10px; cursor:pointer;
    border-radius: 4px; display: inline-block; vertical-align: middle; float: none;
}
  .tagList label{display: inline-block;}
  .tagList input{float: left; margin: 5px;}
  .span12{margin-top: 28px;}
  .span6{border: 1px solid #EEEEEE;}
  .addition {border-bottom: 1px solid #EEEEEE; margin:10px auto;}
  .controls img { width: 60px; vertical-align: middle; }

</style>
<script type="text/javascript">
  window.onload=function (){
        var boardId = "{$boardId}";
        $("#boardList>li").each(function(){
          if($(this).attr("data-value") == boardId){
              $(this).css("background-color", "yellow");
            }
        });
        if(boardId == 'hotans' || boardId == 'showtime')
        {
          $("[name='sortOrder']").attr("disabled", true);
        }
  }
</script>
<div class="boardDiv">
  <button class="btn ml-10" disabled="disabled">版块：</button>
  <ul id="boardList" class="boardList">
    {loop $boardList $k $v}
      <li data-value="{$v['boardId']}"><a href="index.php?c=admin&a=board&boardId={$v['boardId']}">{$v['boardName']}</a></li>
    {/loop}
    <!-- {if $action != 'add'}<li><a href="index.php?c=admin&a=board&action=add">添加一个</a></li>{/if} -->
  </ul>
</div>
<div class="pt-10">
  <div class="row-fluid">
    <div style="height:547px;" class="boardInfo span6">
      <form enctype="multipart/form-data" method="post" action="index.php?c=admin&a=editBoard" class="form-horizontal">
          <div class="control-group">
            <label class="control-label">版块图：</label>
            <div class="controls">
              {if $boardInfo['boardImg']}
                <img src="{$boardInfo['boardImg']}" alt="版块图">
              {/if}
              <input type="file" name="boardImg">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label">版块id：</label>
            <div class="controls">
              <input type="text" name="boardId" readonly="readonly" value="{$boardInfo['boardId']}">
              <p><span>请使用英文并不多于12个字母</span></p>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label">版块名：</label>
            <div class="controls">
              <input type="text" name="boardName" value="{$boardInfo['boardName']}">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label">版块描述：</label>
            <div class="controls">
              <input type="text" name="boardDesc" value="{$boardInfo['boardDesc']}">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label">版块排序号：</label>
            <div class="controls">
              <input type="text" name="sortOrder" value="{$boardInfo['sortOrder']}">
              <p><span>序号越小排位越靠前</span></p>
            </div>
          </div>
          <div class="control-group">
            <label class="control-label">版块下标签：</label>
            <div class="controls tagList">
              <ul id="taglistOn">
                {loop $tagList $k $tag}
                    <li><input type="checkbox" name="tag[]" checked="checked" disabled="disabled" id="tagId_{$tag['tagId']}" value="{$tag['tagId']}"><label for="tagId_{$tag['tagId']}">{$tag['tagName']}</label></li>
                {/loop}
              </ul>
            </div>
          </div>
          <div class="control-group">
            <div class="controls">
                {if $action == 'add'}
                  <input type="hidden" name="action" value="insert">
                {elseif $action == 'edit'}
                  <input type="hidden" name="action" value="update">
                {/if}
                <button type="submit" class="btn">提交</button>
            </div>
          </div>
      </form>
    </div>
    {if $addition}
    <div class="span6">
    <form enctype="multipart/form-data" method="post" action="index.php?c=admin&a=editBoardAddition" class="form-horizontal">
        {loop $addition $k $v}
        <div class="addition" id="addition_{$k}">
            <div class="control-group">
              <label class="control-label">logo：</label>
              <div class="controls">
                {if $v['img']}
                  <img width="70" src="{$v['img']}" alt="logo">
                  <input type="hidden" name="img[{$k}]" value="{$v['img']}">
                {/if}
                <input type="file" name="img_{$k}">
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">标题：</label>
              <div class="controls">
                <input type="text" name="name[{$k}]" value="{$v['name']}">
                <input type="hidden" name="id[{$k}]" value="{$v['id']}">
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">描述：</label>
              <div class="controls">
                <input type="text" name="description[{$k}]" value="{$v['description']}">
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">链接：</label>
              <div class="controls">
                <input type="text" name="link[{$k}]" value="{$v['link']}" class="xx-large">
              </div>
            </div>
            <div class="control-group">
              <label class="control-label">是否有效：</label>
              <div class="controls">
                <select name="is_show[{$k}]" class="input-mini">
                  <option {if $v['is_show'] == 1} selected="selected" {/if} value="1">是</option>
                  <option {if $v['is_show'] == 0} selected="selected" {/if} value="0">否</option>
                </select>
              </div>
            </div>
        </div>
        {/loop}
        <div class="control-group">
          <div class="controls">
              <input type="hidden" name="boardId" value="{$boardId}">
              <button type="submit" class="btn">提交</button>
          </div>
        </div>
    </form>
    </div>
    {/if}
</div>
{template footer}